<?

	/*一个备用函数*/
	function getContent( $sourceStr, $startStr, $endStart ){    
		$s = preg_quote( $startStr );
		$e = preg_quote( $endStart );
		preg_match_all( "@" . $s . "(.*?)". $e ."@is", $sourceStr, $tpl );
		$content = $tpl[1];
		$content = implode( "", $content );
		return $content;
	}


	switch($action){
		case 'ajax':
			
			 $file=file_get_contents("http://www.weather.com.cn/weather/101010100.shtml");
 
			 eregi("<title>(.*)</title>", $file,$title);
			 $data = $title[1];
			 
			
			$data = preg_replace('/(.+?)\:/', '' , $data); // 过滤标题不要的文字
			$data = str_replace('晴', "<img src=\"modules/weather/images/晴.png\"/>" , $data);
			 print_r($data);
 
 
		break;
		
		default:
		
		break;
	}
?>